<template>
	<view>
		<view class="u-flex" @click="check">
			<slot name="image">
			</slot>
			<view class="u-margin-left-20" style="color: #333;font-weight: bold;">{{case_type}}</view>
		</view>
		
		<u-action-sheet :list="list" v-model="show" @click="select"></u-action-sheet>
	</view>
</template>

<script>
	export default{
		props:{
		
			type:{
				type:String,
				
			},
			data:{
				type:Array
			}
		},
		data(){
			return{
				list: [],
				show: false,
				case_type:"全部"
			}
		},
		methods:{
			check(){
				if(this.type=="效果图"  || this.type=="全景漫游"){
						this.list=[{
						text: '家装设计',
						type:1
					}, {
						text: '工装设计',
						type:2
					}]
				}
				
				if(this.type=="自学装修"){
					this.data.forEach(item=>{
						item.text=item.classifyName
					})
					this.list=this.data;
				}
				
				
				this.show=true;
			},
			select(e){
				this.case_type=this.list[e].text;
				this.$emit("select",this.list[e])
			}
		}
	}
</script>

<style>
</style>
